#ifndef FHE_PYTHON_PYENV_H
#define FHE_PYTHON_PYENV_H

#include <fhe/core/Val.h>
#include <boost/python.hpp>

namespace fhe
{
  using namespace core;
  namespace python
  {
    class FHE_API PyEnv
    {
    public:
      static PyEnv& instance();
      ~PyEnv();
      
      boost::python::dict defaultNamespace();
      
      void runFile( const std::string& filename, boost::python::dict ns );
      void exec( const std::string& script, boost::python::dict ns );
      boost::python::object eval( const std::string& script, boost::python::dict ns );
      
      std::string getType( boost::python::object obj );
      std::string toString( boost::python::object obj );
      
      boost::python::object convertVal( const Val& val );
      Val convertVal( boost::python::object obj );
      
      bool callable( boost::python::object obj );
      
    private:
      PyEnv();
      PyEnv( const PyEnv& );
      void operator=( const PyEnv& );
    
      boost::python::object mainModule_;
      boost::python::object mainNamespace_;
      boost::python::object builtins_;
    };
  }
}

#endif
